/*
 * TCSS 422 - Spring quarter 2011
 * Team: 	Googlers
 * Members: Deepa Sahni, Krisnil Gounder, Michael Schweiger
 * Date: 	April 8, 2011
 */
package ui;

/**
 * A console based output reporter object to report data that is given to it.  Any objects
 * are reported via toString method, so if a custom message is requested, embed the
 * entire message into a new String and give this the new string.
 * @author Michael Schweiger
 * @version 1.0
 */
public class ConsoleReporter extends Reporter {

	/**
	 * Continually displays the data that has been given to it.  Data is displayed in
	 * the order given.
	 */
	protected void display() {
		while (true) {
			if (!hasMoreData()) {
				try {
					wait();
				} catch (final InterruptedException e) {
					//interrupted, move on.
				}
			}
			while (hasMoreData()) {
				System.out.println(getNextObject().toString() + "\n");
			}
		}
	}

}
